<template>
	<view>
		<view class="fixedHeader">
			<uni-search-bar placeholder="搜索商品" v-model="searchKeyword"></uni-search-bar>
		</view>

		<goodsItems :filters="filters" :searchKeyword="searchKeyword"></goodsItems>

	</view>

</template>

<script>
	import goodsItems from './items.vue'

	export default {
		components: {
			goodsItems
		},
		data() {
			return {
				filters: {
					categoryId: undefined,
					productZone: undefined,
					maxPoints: undefined,
					minPoints: undefined,
				},
				searchKeyword: '',
			};
		},
		onLoad(e) {
			console.log(e)
			this.filters.categoryId = e.categoryId === undefined ? undefined : parseInt(e.categoryId)
			this.filters.productZone = e.productZone === undefined ? undefined : parseInt(e.productZone)
			this.searchKeyword = e.keyword === undefined ? '' : e.keyword
		},
		methods: {}
	}
</script>

<style>
	.fixedHeader {
		position: sticky;
		top: 0;
		right: 0;
		left: 0;
		z-index: 100;
		background-color: white;
	}
</style>